home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Add-Ons / MPW / MPW noweb 2.7 / src / xdoc / noindex.1 < prev    next >
Encoding:
Text File  |  1995-05-30  |  3.1 KB  |  161 lines  |  [TEXT/MPS ]

  1. .TH NOWEB 1 "local 4/19/93"
  2. .SH NAME
  3. noindex \- build external index for noweb document
  4. .SH SYNOPSIS
  5. .B noindex \fIbasename\fP\fR[\fP.tex\fR]
  6. .SH DESCRIPTION
  7. .I noindex
  8. looks through 
  9. .I LaTeX
  10. .B .aux
  11. files for identifiers that should go in a
  12. .I noweb
  13. external index.
  14. It sorts all identifiers and writes the results on
  15. .I basename\fB.nwi\fP.
  16. .SH NOWEB INDEXING STRATEGIES
  17. .I noweb
  18. program consists of one or more files.
  19. In the simple case, these files are run through
  20. .I noweave
  21. together, to produce a single
  22. .I LaTeX
  23. file.
  24. .I noweave \-index
  25. suffices to produce an index and cross-referencing information;
  26. neither 
  27. .I nodefs
  28. nor
  29. .I noindex
  30. is required.
  31. .PP
  32. When a 
  33. .I noweb
  34. program
  35. consists of several source files, it is often better to run each source file
  36. through 
  37. .I noweave
  38. to produce its own 
  39. .I LaTeX 
  40. file, then use
  41. .I noindex
  42. to produce an external index.
  43. This technique has several advantages:
  44. .IP
  45. The line numbers in the 
  46. .I LaTeX
  47. files correspond to the line numbers in the source files, so it is easier
  48. to diagnose 
  49. .I LaTeX
  50. errors.
  51. .IP
  52. The
  53. .I LaTeX
  54. .B "\\\\includeonly"
  55. feature can be used, making it possible to format parts of large programs while retaining
  56. complete cross-reference information.
  57. .IP
  58. When used with
  59. .I make(1),
  60. the technique 
  61. avoids running 
  62. .I noweave
  63. over source files that have not changed.
  64. .IP
  65. Using the external index places fewer demands on \fILaTeX\fP's memory,
  66. making it read its
  67. .B .aux
  68. files much more quickly.
  69. .PP
  70. The disadvantages are that 
  71. .I nodefs
  72. and 
  73. .I noindex
  74. are needed for full cross-referencing and a properly sorted index.
  75. .SH EXAMPLE
  76. This example assumes a 
  77. .I noweb
  78. program of three source files:
  79. .B a.nw, b.nw, 
  80. and
  81. .B c.nw.
  82. The file
  83. .B doc.tex
  84. is assumed to contain 
  85. .I LaTeX
  86. boilerplate, including the commands
  87. .IP
  88. \\noweboptions{externalindex}
  89. .nf
  90. \\include{a}
  91. \\include{b}
  92. \\include{c}
  93. .fi
  94. .PP
  95. The first sequence of steps is to create a file listing all the
  96. identifiers defined anywhere in 
  97. .B a, b,
  98. or 
  99. .B c.
  100. .IP
  101. nodefs a.nw > a.defs
  102. .nf
  103. nodefs b.nw > b.defs
  104. nodefs c.nw > c.defs
  105. sort -u a.defs b.defs c.defs | cpif all.defs
  106. .fi
  107. .PP
  108. Using
  109. .I sort -u
  110. and
  111. .I cpif(1)
  112. avoids changing
  113. .B all.defs
  114. unless the set of identifiers changes.
  115. This technique, used in a Makefile, avoids unnecessary rebuilding.
  116. .PP
  117. The next series of steps is to create
  118. .I LaTeX
  119. files with full cross-reference information for all identifiers.
  120. .IP
  121. noweave -n -indexfrom all.defs a.nw > a.tex
  122. .nf
  123. noweave -n -indexfrom all.defs b.nw > b.tex
  124. noweave -n -indexfrom all.defs c.nw > c.tex
  125. .fi
  126. .PP
  127. The final steps run
  128. .I LaTeX
  129. once to create
  130. .B .aux
  131. files, then
  132. .I noindex 
  133. to create the index,
  134. then
  135. .I LaTeX
  136. again to format the complete document.
  137. .IP
  138. latex doc
  139. .nf 
  140. noindex doc
  141. latex doc
  142. .fi
  143. .PP
  144. In a Makefile,
  145. .I noindex
  146. can be run before every invocation of
  147. .I LaTeX.
  148. .SH BUGS
  149. .I noindex
  150. is distributed in awk and Icon versions.
  151. The awk version is slow and does a poorer job sorting.
  152. .PP
  153. There is no comparable machinery to make it possible to use multiple files 
  154. with the HTML back end.
  155. .SH SEE ALSO
  156. .I noweave(1), nodefs(1), cpif(1)
  157. .SH AUTHOR
  158. Norman Ramsey, Bellcore.
  159. Internet address \fBnorman@bellcore.com\fP.
  160.